package cn.skyquant.quant4j.jforex.sdk.util;


import cn.skyquant.quant4j.sdk.enums.TradeDirection;
import com.dukascopy.api.OfferSide;
import com.dukascopy.api.Period;

public final class EnumMatch {
    public static final com.dukascopy.api.Period convertPeriod(cn.skyquant.quant4j.sdk.util.time.Period period){
        switch (period){
            case daily:return Period.DAILY;
            case h1:return Period.ONE_HOUR;
            case h4:return Period.FOUR_HOURS;
            case m1:return Period.ONE_MIN;
            case m5:return Period.FIVE_MINS;
            case m15:return Period.FIFTEEN_MINS;
            case m30:return Period.THIRTY_MINS;
            case week:return Period.WEEKLY;
            case month:return Period.MONTHLY;
            default:return Period.DAILY;
        }
    }

    public static final OfferSide convertOfferSide(TradeDirection td){
        return td==TradeDirection.LONG?OfferSide.ASK:OfferSide.BID;
    }
}
